// 登录拦截器
module.exports = (req, res, next) => {
    const url = req.url;
    if (url != '/login' && req.session.username == null) {
        res.redirect('/admin/login')
    } else {
        if ('normal' == req.session.role) {
            return res.redirect('/home');
        }
        next();
    }
}